package com.iweb.controller;

import com.common.context.RequestMapping;
import com.iweb.pojo.Hotel;
import com.iweb.pojo.User;
import com.iweb.service.HotelService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RequestMapping("hotel")
public class HotelController {



    @RequestMapping("selectHotelList")
    public String selectHotelList(Hotel hotel, HttpServletRequest request){
        HotelService hotelService=new HotelService();
        String hotel_name=null;
        if(hotel!=null){
            hotel_name=hotel.getHotel_name();
        }

        List<Hotel> list=hotelService.selectHotelList(hotel_name);
        request.setAttribute("list",list);

        return "/hotel/selectHotelList.jsp";
    }

    @RequestMapping("selectByLocal")
    public String selectByLocal(Hotel hotel,HttpServletRequest request){
        HotelService hostServices=new HotelService();
        String hotel_local =null;
        if(hotel!=null){
            hotel_local=hotel.getHotel_local();
        }

        List<Hotel> list=hostServices.selectByLocal(hotel_local);
        request.setAttribute("list",list);

        return "/hotel/hotelIndex.jsp";
    }


}
